/*
 * @Author: xiaotiwen
 * @Date: 2020-05-28 18:03:23
 * @LastEditTime: 2020-07-07 19:02:29
 * @LastEditors: xiaotiwen
 * @FilePath: \eduweb\src\api\practiceManagement\dispersionPracticeApply.js
 * @Description: 分散实习接口
 */
import fetch from 'common/src/utils/fetch';
import baseUrl from './env';
import UTILS from "common/src/utils/utils";

// 列表
export function getList(data) {
    return fetch({
        url: `${baseUrl}/udgPtDispersePracticApplyInfoT/query`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 已选课程
export function getCourses(data) {
    return fetch({
        url: `${baseUrl}/udgPtDispersePracticApplyInfoT/getCourses`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 删除
export function deleteById(data) {
    return fetch({
        url: `${baseUrl}/udgPtDispersePracticApplyInfoT/deleteById`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 详情
export function getDetail(data) {
    return fetch({
        url: `${baseUrl}/udgPtDispersePracticApplyInfoT/getDetail`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 新增保存
export function addSave(data) {
    return fetch({
        url: `${baseUrl}/udgPtDispersePracticApplyInfoT/add`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
// 提交
export function dataSubmit(data) {
    return fetch({
        url: `${baseUrl}/udgPtDispersePracticApplyInfoT/submit`,
        method: 'POST',
        headers: {
            'Content-Type': 'application/json'
        },
        data
    });
}
//导出
export function exportData(data) {
    return fetch({
        url: `${baseUrl}/udgPtDispersePracticApplyInfoT/exportTable`,
        method: "post",
        responseType: "blob",
        data
    }).then(res => {
        UTILS.downloadFile(
            res,
            "分散实习列表.xls",
            "application/vnd.ms-excel;charset=utf-8"
        );
    });
}
